package cn.springcloud.fix.es;

import java.util.ArrayList;
import java.util.List;

public class LeeCode {

    public static void main(String[] args) {
        System.out.println(111);
    }

    public static int maxProfit(int[] prices) {
        if (prices.length <= 1) return 0;
        int sum = 0;
        for (int i = 1; i < prices.length; i++) {
            int n = prices[i] - prices[i - 1];
            if (n > 0) {
                sum = sum + n;
            }
        }
        return sum;
    }
}
